package com.chinaunicom.create.singleton.lazy;

/**
 * @author liry
 * @version 1.0
 * @date Created on 2022/7/14 11:09
 * Description: 懒汉模式（静态常量）
 */
public class LSingleton01 {
    // 静态常量：创建对象
    private static LSingleton01 LSingleton01 = new LSingleton01();
    
    private LSingleton01(){}
    
    public static LSingleton01 getInstance(){
        return LSingleton01;
    }


    public static void main(String[] args) {
        LSingleton01 instance1 = LSingleton01.getInstance();

        LSingleton01 instance2 = LSingleton01.getInstance();

        System.out.println(instance1.equals(instance2));
    }
}
